package cn.dm.controller;

import cn.dm.Service.UserLoginService;
import dto.Dto;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("user")
public class UserController {


    @Resource
    private UserLoginService userLoginService;

    @ResponseBody
    @RequestMapping(value ="UserLogin",method = RequestMethod.POST)
    public Dto UserLogin(@RequestParam("phone") String phone,@RequestParam("password") String password) throws Exception{
        return userLoginService.Login(phone,password);
    }
}
